package under.wsl.tests.main;

import java.util.HashMap;
import java.util.Map;

import under.wsl.controle.Controlador;
/*
import under.wsl.decode.DefaultJsonDecode;
import under.wsl.tests.control.Teste;
import under.wsl.tests.model.Oi;
*/



public class Main {
	/**
	 * @param args
	 */
		
	public static void main(String[] args) {	
			/*teste com metodo com parametro*/
			//String[] s = {"Teste.falarVariosOis"} ;
			String[] s = {"control.Teste.falarBemVindo3"} ;
			//String[] s = {"Teste.limparOi"} ;
			String[] p = {"8","10"} ;
			String[] texto = {"comecou"};
			String[] momento = {"20-2-2014"};
			String[] idOi = {"19999"};
			String[] idRequest = {"12"} ;
            String[] ativo = {"S"} ;
			String[] tk = {"2"} ;
			String[] t = {"4"} ;
			String[] datatype = {"jsonp"} ;
			String[] cb = {"retornowssss"} ;
			
			Map<String, String[]> parameters = new HashMap<String, String[]>();
			parameters.put("s", s);
			parameters.put("p",p);
			parameters.put("texto",texto);
			parameters.put("momento",momento);
			parameters.put("idOi",idOi);
			parameters.put("ativo",ativo);
			parameters.put("tk", tk);
			parameters.put("format",datatype);
            parameters.put("idRequest", idRequest);
            parameters.put("callback", cb);
			parameters.put("t", t);
			
			try {
                   Controlador.getInstancia().deployWS(parameters,"under.wsl.tests");
                   idRequest[0] = "43";
                   s[0] = "control.Teste.getOis";
                   datatype[0] = "json";
                   parameters.put("idRequest", idRequest);
                   parameters.put("format",datatype);
                   Controlador.getInstancia().deployWS(parameters,"under.wsl.tests");
                   
                   s[0] = "control.Teste.falarBemVindo6";
                   idRequest[0] = "6";
                   datatype[0] = "json";
                   parameters.put("idRequest", idRequest);
                   parameters.put("format",datatype);
                   parameters.put("s",s);
                   Controlador.getInstancia().deployWS(parameters,"under.wsl.tests");
                   
			} catch (Exception e) {
                   Controlador.getInstancia().addErro(e.getMessage().toString());	
			}	
		
			//System.out.printl
			
			System.out.println(Controlador.getInstancia().getResult(12));
			// System.out.println( Controlador.getInstancia().getResult());
			System.out.println(Controlador.getInstancia().getResult(43));
			//Controlador.getInstancia().removeRequestService(12);
			//System.out.println(Controlador.getInstancia().getResult(12));
			
			//Controlador.getInstancia().removeRequestService(6);
			System.out.println(Controlador.getInstancia().getResult(6));			
			
			//DefaultJsonDecode djd = new DefaultJsonDecode();			
			//System.out.println(djd.toJson(new Teste().getOis(new Oi(1,"a muleque",null,'S'))));	
        }
}
